import React, { useEffect, useState } from 'react'
import Echart from '../../components/Echart/Echart'
import { Col, Row } from 'antd'
import { getEchart } from '../../api/modules/echart'
export default function Echarts() {
    const [data, setData] = useState()
    useEffect(() => {
        getEchart().then(res => {
            setData(res.data)
        })
    }, [])
    return (
        <div>
            {data && <>
                <Row>
                    <Col span={12}>
                        <Echart option={data.option} />
                    </Col>
                    <Col span={12}>
                        <Echart option={data.option2} />
                    </Col>
                </Row>
                <Row>
                    <Col span={12}>
                        <Echart option={data.option3} />
                    </Col>
                    <Col span={12}>
                        <Echart option={data.option4} />
                    </Col>
                </Row>

            </>}

        </div>
    )
}
